<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Login</title>
</head>
<body>
<form action="/LoginTest/login" method="get">
		用户名:<input type="text" name="username" placeholder="输入用户名" 
		value="<%=session.getAttribute("username")==null?"":session.getAttribute("username") %>"><br/>
		密码: <input type ="password" name ="password" placeholder="输入密码"
		 value="<%=session.getAttribute("password")==null?"":session.getAttribute("password") %>"><br/>
		验证码：<input type="text" name="code" placeholder="输入验证码" >
		<img id="imgId" src="/LoginTest/CheckCode"><br>
		<a href="#" onclick="run()">看不清，换一张</a>
		<input type="submit" value="登录">
	</form>

</body>
<script type="text/javascript">
	function run(){
		var image=document.getElementById("imgId");
		image.src="/LoginTest/CheckCode?"+new Date().getTime();
	}
</script>
</html>